package com.li.springbootproject.spring.order;


import java.util.List;
import java.util.Map;

import com.li.springbootproject.utils.SpringContextUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2/22/2022 8:21 AM
 */
@Component
@Order(1)
public class OrderTestOne implements CommandLineRunner {

    private static final Logger logger = LoggerFactory.getLogger(OrderTestOne.class);

    /**
     * 执行
     *
     * @param args 参数
     * @throws Exception
     */
    @Override
    public void run(String... args) throws Exception {
        JdbcTemplate jdbcTemplate = SpringContextUtils.getBean(JdbcTemplate.class);
        List<Map<String, Object>> list = jdbcTemplate.queryForList("select 1");
        logger.info("OrderTestOne...");
    }
}
